import React, { PureComponent } from 'react';
import { Card, WingBlank, WhiteSpace, Accordion, List } from 'antd-mobile';
import { connect } from 'dva';
import ast from './index.less';
import md5 from 'md5';
import { createForm, formShape } from 'rc-form';
import { Divider } from 'antd';
const PlaceHolder = ({ className = '', ...restProps }) => (
  <div className={`${className} placeholder`} {...restProps}>Block</div>
);

class Culture extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
    };
  }
  componentWillMount() {
    this.props.dispatch({ type: "evaluationModule/getLoadSecTeachTaskCourseListForTeacher" })
  }
  // 
  render() {
    return (
      <div>
        {this.props.list.length == 0 ? null : this.props.list.map((s, key) => {
          return (
            <WingBlank size="lg" key={key}>
              <WhiteSpace size="lg" />
              <Card>
                <Card.Header
                  title={<p style={{ fontSize: '12px' }}>{s.courseName}</p>}
                  thumb={<img style={{ width: '43px', height: '43px', marginRight: "1rem" }} src="http://www.kingmon.cn/resources/desk/images/i4.png" />}
                />
                <Card.Body>
                  <div>{
                    <div>
                      <p style={{ fontSize: "1rem", lineHeight: "1.5rem" }}>{`学期：${s.termName}`}</p>
                      <Accordion style={{ marginTop: "1rem" }} className="my-accordion" onChange={this.onChange}>
                        <Accordion.Panel key={s.orgCode} header={<span style={{ fontSize: "14px" }}>{`课程编号：${s.courseNum}`}</span>}>
                          <List className="my-list">
                            <List.Item>{`上课教师：${s.teachers}`}</List.Item>
                            <List.Item>{`余量：${s.surplus}`}</List.Item>
                            <List.Item>{`上课时间：${s.attendClass}`}</List.Item>
                            <List.Item>{`上课地点：${s.roomName}`}</List.Item>
                            <List.Item>{`上课班级：${s.teachClass}`}</List.Item>
                            <List.Item>{`是否开课：${s.isOpen ? '是' : '否'}`}</List.Item>
                          </List>
                        </Accordion.Panel>
                      </Accordion>
                    </div>
                  }</div>
                </Card.Body>
                <Card.Footer content=" " extra={<div> </div>} />
              </Card>
              <WhiteSpace size="lg" />
            </WingBlank>
          )
        })}
      </div>
    );
  }
}
function mapStateToProps(state) {
  return {
    list: state.evaluationModule.list,
    // course: state.trainingProgramModule.course
  }
}
export default connect(mapStateToProps)(Culture);
